<?php
class IndexAction extends Action {
    //首页
    public function index(){
    	$this->assign('xiamiUrl',C('XIAMI_URL'));
    	$this->display();//输出页面模板
    }

    /**
     * Ajax 修改配置
     * @return [type]
     */
    public function config(){
    	if(session('user') == null){
    		echo 'Please login first.'; exit();
    	}else{
    		$token = I('token');
    		$xiami = I('xiami');
    		$data = array(
    			'TOKEN' => $token, 
    			'XIAMI_URL' => $xiami
    		);    		
    		F('app',$data,CONF_PATH);
    		$this->ajaxReturn(null);
    	}
    }
}